public class Pawn implements Piece {

    private Color color;
    private int moveCount;

    public Pawn( Color color ) {
	this.color = color;
	moveCount = 0;
    }

    public boolean legalMove( int x1, int y1, int x2, int y2) {
	if( this.color == Color.WHITE ) {
	    if( (y2 == y1) && (x2 == x1+1) ) {
		return true;
	    } 
	} else {
	    if( (y2 == y1) && (x2 == x1-1) ) {
		return true;
	    }
	}
	return false;
    }

    public Color color() {
	return color;
    }

    public String name() {
	return "Pawn";
    }

    public void movesPlusOne() {
	moveCount += 1;
    }
    
    public int moveCount() {
	return moveCount;
    }

}
